﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AppInfo.aspx.cs" Inherits="CardLogistics.Web.Controls.AppInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.tipswindow.2.0.js" type="text/javascript"></script>
    <script src="../js/valReq.js" type="text/javascript"></script>
    <title>审批</title>
    <script language="javascript" type="text/javascript">

        $("#CloseTip").live("click", function () {	//默认关闭按钮
            $.tipsWindow.removeBox();
        });

        $("#SubTip").live("click", function () {

            var appStatus = "";
            //得到radiobuttonlist
            var vRbtid = document.getElementById("rbappStatus");
            //得到所有radio
            var vRbtidList = vRbtid.getElementsByTagName("INPUT");
            for (var i = 0; i < vRbtidList.length; i++) {
                if (vRbtidList[i].checked) {
                    appStatus = vRbtidList[i].value;
                }
            }
            var altStr = "";
            for (var i = 0; i < vRbtidList.length; i++) {
                if (vRbtidList[i].checked) {
                   //审批结果为“审批不通过”和“驳回”时则需要判断审批意见是否为空
                    if (vRbtidList[i].value != 1)
                        altStr = valid_isempty('APPCONTENT', '审批意见');
                }
            }
            if (altStr != "") {
                alert(altStr);
                return false;
            }
            else {
                var content = document.getElementById("APPCONTENT").value; //审批意见
                $.ajax(
                  {
                      type: 'get', //页面的提交方式
                      url: '../../../Controls/HdAppro.ashx', //一般处理文件的路径
                      data: 'APPCONTENT=' + encodeURI(content) + "&appStatus=" + appStatus + "&UserId=" + "<%=UserId %>" + "&InfoId=" + "<%=InfoId %>" + "&InfoType=" + "<%=InfoType %>", //传入的参数
                      dataType: 'html',
                      success: function (content) {
                          if (content == "ok") {
                              window.returnValue = "ok";
                              $.tipsWindow.removeBox();
                              window.location.reload();
                              return true;
                          }
                          else {
                              alert("审批失败！");
                              $.tipsWindow.removeBox();
                          }
                      }
                  }
                  )
            }
        })
    </script>
</head>
<body>
    <form id="frmApp" runat="server">
    <div class="rightinfo">
        <div runat="server" id="d_Info" style="color: Red;">
            提示:审核操作提交后将不可再次审核!</div>
        <table class="theForm" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="135px" style="text-align:right; width:150px; ">
                    审批意见：
                </td>
                <td>
                    <textarea id="APPCONTENT" maxlength="300" class="txtareinput" runat="server" style="height: 110px;"></textarea>
                </td>
            </tr>
            <tr>
                <td style="text-align:right; width:150px; ">
                    审批结果：
                </td>
                <td>
                    <asp:RadioButtonList ID="rbappStatus" runat="server" RepeatDirection="Horizontal"
                        RepeatLayout="Flow" Width="233px">
                        <asp:ListItem Selected="True" Value="1">通过 </asp:ListItem>
                        <asp:ListItem Value="2">不通过 </asp:ListItem>
                        <asp:ListItem Value="3">驳回</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        </table>
        <div style="height: 50px; padding-top: 10px; margin-left: 200px;">
            <div id="d_Sub" runat="server" style="float: left;">
                <input name="" id="SubTip" type="button" class="btn" value="提交" /></div>
            <div style="float: left;">
                <input name="" id="CloseTip" type="button" class="btn" value="取消" style="float: left;" /></div>
        </div>
    </div>
    </form>
</body>
</html>
